local skel = fk.CreateSkill({
  name = "lb__jueyi",
  tags = {Skill.Compulsory}
})

Fk:loadTranslationTable {
  ["lb__jueyi"] = "绝意",
  [":lb__jueyi"] = "<b>锁定技</b>，仅<font color='red'>♦</font>、<font color='red'>♥</font>、♠、♣牌可对你造成伤害。将伤害牌的对应花色从描述中移除。",

  ["@[suits]lb__jueyi"] = "绝意",

  ["$lb__jueyi1"] = "旧世界崩塌。",
  ["$lb__jueyi2"] = "休想夺走希望！",
}

skel:addEffect(fk.DetermineDamageInflicted, {
  anim_type = "defensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(skel.name) and not data.prevented
    and (not data.card or 
    (#player:getTableMark("@[suits]lb__jueyi") > 0 and not table.contains(player:getTableMark("@[suits]lb__jueyi"), data.card.suit)))
  end,
  on_use = function(self, event, target, player, data)
    data:preventDamage()
  end,
})

skel:addEffect(fk.Damaged, {
  anim_type = "defensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(skel.name) 
    and data.card and table.contains(player:getTableMark("@[suits]lb__jueyi"), data.card.suit)
  end,
  on_use = function(self, event, target, player, data)
    player.room:removeTableMark(player, "@[suits]lb__jueyi", data.card.suit)
  end,
})

skel:addAcquireEffect(function(self, player)
  player.room:setPlayerMark(player, "@[suits]lb__jueyi", {1, 2, 3, 4})
end)

skel:addLoseEffect(function(self, player)
  player.room:setPlayerMark(player, "@[suits]lb__jueyi", 0)
end)

return skel